<!-- 产品库存 -->
<template>
    <StockList v-if="isIndex" @to-detail="handleToDetail"></StockList>
    <StockDetail v-else :detailInfo @to-list="isIndex = true"></StockDetail>
</template>

<script setup lang='ts' name="AccompIndex">
import StockList from './StockList.vue';
import StockDetail from './StockDetail.vue';
const detailInfo = reactive<{
    data: Partial<AcompUser>;
    type: 'edit' | 'add' | 'view' | null;
}>({
    data:{},
    type:null 
})
const isIndex = ref(true);
const handleToDetail = (type:'edit' | 'add' | 'view', row:Partial<AcompUser>)=>{
    isIndex.value = false;
    Object.assign(detailInfo, {
        data: row,
        type
    });
}
</script>
<style scoped lang='scss'>

</style>